package rlm.helper;

import java.util.HashMap;
import java.util.Map;

public class ComponentNamer {

	private Map<Class, Integer> indices;
	
	public ComponentNamer(){
		indices = new HashMap<Class, Integer>();
	}
	
	public String createName(Object obj){
		Integer ans = indices.get(obj.getClass());
		if (ans == null){
			ans = new Integer(1);
		}
		
		indices.put(obj.getClass(), ans.intValue()+1);
		return obj.getClass().getSimpleName() + ans.intValue();
	}
}
